#include <glib.h>

gint main(gint argc, gchar **argv)
{
    gsize out_len = 0;
    gchar *base64_en_data = NULL;
    gchar *base64_de_data = NULL;
    const guchar *ori_data = "ABCD\n";

    g_print("ori_data: %s \n", ori_data);

    base64_en_data = g_base64_encode(ori_data, strlen(ori_data));
    g_print("base64 encode:%s -> %s \n", ori_data, base64_en_data);

    base64_de_data = g_base64_decode(base64_en_data, &out_len);
    g_print("base64 decode:%s -> %s \n", base64_en_data, base64_de_data);
    
    g_free(base64_en_data);
    g_free(base64_de_data);

    return 0;
}